import { reqSearch } from "@/api";

const state = {
  searchInfo: {},
};
const mutations = {
  GETSEARCHLIST(state, data) {
    state.searchInfo = data;
  },
};
const actions = {
  async getsearchlist({ state, commit, dispatch }, data) {
    let res = await reqSearch(data);
    commit("GETSEARCHLIST", res.data);
  },
};
const getters = {
  goodsList(state) {
    return state.searchInfo.goodsList;
  },
  attrsList(state) {
    return state.searchInfo.attrsList;
  },
  trademarkList(state) {
    return state.searchInfo.trademarkList;
  },
};
export default { namespaced: true, state, mutations, actions, getters };
